<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common_tag.jsp"%>
<!-- 应用上下文 -->
<html>
	<head>
		<script type="text/javascript">
		var sexdata = [
		    		    {id:'SX-0',name:'女'},
		    		    {id:'SX-1',name:'男'}
		    			];
		var rship = [
		    		    {id:'RP-0',name:'父母'},
		    		    {id:'RP-1',name:'亲属'},
		    		    {id:'RP-2',name:'朋友'}
		    			];

		var cardType = [
						{id:'CA-0',name:'身份证'},
						{id:'CA-1',name:'护照'},
						{id:'CA-2',name:'驾照'},
						{id:'CA-3',name:'军官证'}
		        		];

		function btn_save (){
			var flag = $('#stuInfoForm').form('validate');
			if(flag){
				$.ajax({
		   			url: "student_addStudent.do",
		   			type: "post",
		   			data: $("#stuInfoForm").serialize(),
		   			datatype:"json",
		   			success: function(data){
				    	if(data.MSG=="success"){
				    		$.messager.alert('提示','数据已保存!','info');
		   			    }else{
		   			    	$.messager.alert('提示','数据保存失败!','error');
			   			}
				  	}
				});
		   	}
		}
		</script>
	</head>
	<body>

		<div>
			<form id="stuInfoForm" method="post">
			<div class="pageForm">
				<s:token />
				<div class="pageFormContent">
						<dl  style="float: left">
							<dt>
								姓名：
							</dt>
							<dd>
								<input name="stu.name" type="text" class="easyui-validatebox"
									required="true" />
							</dd>
						</dl>
						<dl >
							<dt>
								民族：
							</dt>
							<dd>
								<select name="stu.nation">
									<option value="1" selected="selected">
										汉族
									</option>
									<option value="0">
										其他
									</option>
								</select>
							</dd>
						</dl>
						<dl >
							<dt>
								出生日期：
							</dt>
							<dd>
								<input class="easyui-datebox" required="true" type="text" name="stu.birthday" validType="date" />
							</dd>
						</dl>
						<dl >
							<dt>
								性别：
							</dt>
							<dd>
								<select class="easyui-validatebox" name="stu.sex">
									<option value="1">
										男
									</option>
									<option value="0">
										女
									</option>
								</select>
							</dd>
						</dl>
						<dl >
							<dt>
								入园日期：
							</dt>
							<dd>
								<input type="text" name="stu.inDate" class="easyui-datebox"
									validType="date"  required="true" />
							</dd>
						</dl>
						<dl >
							<dt>
								入托类型：
							</dt>
							<dd >
								<select class="easyui-validatebox" name="stu.studentType">
									<option value="1">
										正式学生
									</option>
									<option value="2">
										报名式生
									</option>
									<option value="3">
										咨询生
									</option>
								</select>
							</dd>
						</dl>
						<dl >
							<dt>
								户口：
							</dt>
							<dd>
								<input type="text" name="stu.origin" class="easyui-validatebox" />
							</dd>
						</dl>
						<dl >
							<dt>
								家庭地址：
							</dt>
							<dd>
								<input type="text" name="stu.address" class="easyui-validatebox" />
							</dd>
						</dl>
						<dl >
							<dt>
								家庭电话：
							</dt>
							<dd>
								<input type="text" name="stu.fphone" class="easyui-validatebox" />
							</dd>
						</dl>
						<dl >
							<dt>
								照片：
							</dt>
							<dd>
								<input id="testFileInput" type="file" name="stu.photo" size="8" />
							</dd>
						</dl>
					<%--
						<div  style="margin-top: 50px;width:900px;" >
						<table id="tt" 	title="联系人" iconCls="icon-edit" singleSelect="true" idField="itemid" >
								<thead>
									<tr>
										<th field="name" width="100px" editor="text">
											姓名
										</th>
										<th field="relationship" width="100px"
											editor="{type:'combobox',options:{valueField:'id',textField:'name',data:rship,required:true}}">
											关系
										</th>
										<th field="sex" width="50px" align="right"
											editor="{type:'combobox',options:{valueField:'id',textField:'name',data:sexdata,required:true}}">
											性别
										</th>
										<th field="age" width="50px" align="right"
											editor="numberbox">
											年龄
										</th>
										<th field="cardType" width="100px" 
											editor="{type:'combobox',options:{valueField:'id',textField:'name',data:cardType,required:true}}">
											证件类型
										</th>
										<th field="idCard" width="150px" editor="text">
											证件号
										</th>
										<th field="phone1" width="100px" editor="text">
											联系电话
										</th>
										<th field="unit" width="150px" editor="text">
											工作单位
										</th>
										<th field="unitPhone" width="100px" editor="text">
											单位电话
										</th>
									</tr>
								</thead>
							</table>
							
						</div>					
					
						<div class="tabsHeader">
							<div class="tabsHeaderContent">
								<ul>
									<li class="selected">
										<a href="javascript:void(0)"><span>学生联系人</span>
										</a>
									</li>
								</ul>
							</div>
						</div>
						<div class="tabsContent" style="min-height: 200px">
							<div>
								<table class="list nowrap itemDetail" addButton="新增"
									width="100%">
									<thead>
										<tr>
											<th type="text" name="guaList[#index#].name" size="14"
												fieldClass="required">
												姓名
											</th>
											<th type="enum" name="guaList[#index#].relationship"
												enumUrl="${ctx}/basicBusiness/student/pagePart/relationship_select.html"
												size="12">
												关系
											</th>
											<th type="enum" name="guaList[#index#].sex"
												enumUrl="${ctx}/basicBusiness/student/pagePart/sex_select.html"
												size="12">
												性别
											</th>
											<th type="text" name="guaList[#index#].age"
												siz12" fieldClass="required number">
												年龄
											</th>
											<th type="enum" name="guaList[#index#].cardType"
												enumUrl="${ctx}/basicBusiness/student/pagePart/cardType_select.html"
												size="12">
												证件类型
											</th>
											<th type="text" name="guaList[#index#].idCard" size="16">
												证件号
											</th>
											<th type="text" name="guaList[#index#].phone1" size="12"
												fieldClass="required">
												联系电话
											</th>
											<th type="text" name="guaList[#index#].unit" size="12">
												工作单位
											</th>
											<th type="text" name="guaList[#index#].unitPhone" size="12">
												单位电话
											</th>
											<th type="del" width="60">
												操作
											</th>
										</tr>
									</thead>
									<tbody></tbody>
								</table>
							</div>
						</div>
						
					</div>--%>
				</div>

				<div class="formBar">
					<ul>
						<li>
							<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save"
								id="btn_save" onclick="btn_save()">提交</a>
								
						</li>
						<li>
							<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel"
								id="btn_cancel">取消</a>
						</li>
					</ul>
				</div>
				</div>
			</form>
		</div>

	</body>
</html>
